import { createStore } from 'vuex'
import { ajax } from '../api'

export default createStore({
  state: {
    userInfo: null,   // v-if
  },
  mutations: {
    changeUserInfomu(state, payload) {
      state.userInfo = payload
    }
  },
  actions: {
    async changeUserInfoac({ commit }) {
      let { code, result } = await ajax.getuserinfo()
      commit("changeUserInfomu", result)
    }
  },
  modules: {
  }
})
